import time

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

drive = webdriver.Chrome()
drive.maximize_window()
drive.get("https://iviewui.com/view-ui-plus/component/form/cascader")
time.sleep(1)
# 定位到下拉框，实现点击操作
drive.find_element(By.XPATH, "//input[@class='ivu-input ivu-input-default']").click()
time.sleep(3)
# 根据文本包含北京，定位到北京
drive.find_element(By.XPATH, "//li[contains(text(),'北京')]").click()
time.sleep(3)
drive.find_element(By.XPATH, "//li[contains(text(),'王府井')]").click()
time.sleep(3)
drive.close()
